package com.mxpio.erp.common.purchase.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.jpa.model.BizOrder;
import com.mxpioframework.security.annotation.Dict;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PURC_INVOICE")
@Schema(description="采购发票")
public class PurcInvoice extends BizOrder {
	private static final long serialVersionUID = 1L;

	@Override
    public String initTypeCode() {
        return "PV1";
    }

    @Column(name = "INVOICE_NO_")
    @Schema(description = "发票号")
    private String invoiceNo ;

    @Column(name = "INVOICE_TYPE_")
    @Dict(dicCode = "ERP_PURC_INVOICE_TYPE")
    @Schema(description = "发票类型")
    private String invoiceType;

    @Column(name = "INVOICE_STATUS_")
    @Dict(dicCode = "ERP_COMMON_INVOICE_STATUS")
    @Schema(description = "发票状态")
    private String invoiceStatus;

    @Column(name = "INVOICING_DATE_")
    @Schema(description = "开票日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date invoicingDate;

    @Schema(description = "供应商编码")
    @Column(name = "PN_CODE_")
    private String pnCode;

    @Schema(description = "供应商名称")
    @Column(name = "PN_NAME_")
    private String pnName;

    @Schema(description = "开票单位")
    @Column(name = "INVOICING_COMPANY_")
    private String invoicingCompany;

    @Schema(description = "部门")
    @Column(name = "DEPT_NAME_")
    private String deptName;

    @Schema(description = "机构")
    @Column(name = "ORGANIZATION_")
    private String organization;

    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;
}
